<?php

//获取url的跟路径
$segments = explode('/',$_SERVER['SCRIPT_NAME']);
array_pop($segments);
define('SITE_URL','http://'.$_SERVER['HTTP_HOST'].implode('/',$segments));
unset($segments);